package com.iotechn.unimall.app.api.treeOrder;

import com.iotechn.unimall.core.annotation.HttpMethod;
import com.iotechn.unimall.core.annotation.HttpOpenApi;
import com.iotechn.unimall.core.annotation.HttpParam;
import com.iotechn.unimall.core.annotation.HttpParamType;
import com.iotechn.unimall.core.annotation.param.NotNull;
import com.iotechn.unimall.core.exception.ServiceException;
import com.iotechn.unimall.data.domain.TreeDetailOrderDO;
import com.iotechn.unimall.data.domain.TreeOrderDO;
import com.iotechn.unimall.data.model.Page;

import java.util.List;

/**
 *
 *
 * @author hct
 * @email 77802226@qq.com
 * @date 2020-07-21 22:35:48
 */
@HttpOpenApi(group = "treeOrder", description = "")
public interface TreeOrderService{

    @HttpMethod(description = "提交订单")
    String takeOrder(
            @NotNull @HttpParam(name = "treeOrderDO", type = HttpParamType.COMMON, description = "订单请求实例") TreeOrderDO treeOrderDO,
            @NotNull @HttpParam(name = "channel", type = HttpParamType.COMMON, description = "订单提交渠道") String channel,
            @NotNull @HttpParam(name = "userId", type = HttpParamType.USER_ID, description = "userId") Long userId) throws ServiceException;

    @HttpMethod(description = "列表")
    Page<TreeOrderDO> list(
            @HttpParam(name = "page", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
            @HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页长度", valueDef = "20") Integer limit,
            @NotNull @HttpParam(name = "userId", type = HttpParamType.USER_ID, description = "userId") Long userId) throws ServiceException;

    @HttpMethod(description = "展示")
    String form(
            @NotNull @HttpParam(name = "title", type = HttpParamType.COMMON, description = "")String title,
            @NotNull @HttpParam(name = "landIds", type = HttpParamType.COMMON, description = "")String landIds,
            @NotNull @HttpParam(name = "userId", type = HttpParamType.USER_ID, description = "userId") Long userId) throws ServiceException;

    @HttpMethod(description = "详情")
    TreeOrderDO detail(
            @NotNull @HttpParam(name = "orderNo", type = HttpParamType.COMMON, description = "orderNo") String orderNo,
            @NotNull @HttpParam(name = "userId", type = HttpParamType.USER_ID, description = "userId") Long userId) throws ServiceException;

    @HttpMethod(description = "详情")
    TreeDetailOrderDO treeOrderDetail(
            @NotNull @HttpParam(name = "orderDetailId", type = HttpParamType.COMMON, description = "orderDetailId") Long orderDetailId,
            @NotNull @HttpParam(name = "userId", type = HttpParamType.USER_ID, description = "userId") Long userId) throws ServiceException;

    /**
     * 我的资产列表
     * @param userId
     * @return
     * @throws ServiceException
     */
    @HttpMethod(description = "我的详单列表")
    List<TreeDetailOrderDO> treeDetailOrder(
            @NotNull @HttpParam(name = "userId", type = HttpParamType.USER_ID, description = "userId") Long userId) throws ServiceException;

    @HttpMethod(description = "微信预先支付")
    Object wxPrepay(
            @NotNull @HttpParam(name = "orderNo", type = HttpParamType.COMMON, description = "订单串号") String orderNo,
            @NotNull @HttpParam(name = "ip", type = HttpParamType.IP, description = "ip地址") String ip,
            @NotNull @HttpParam(name = "userId", type = HttpParamType.USER_ID, description = "用户Id") Long userId) throws ServiceException;

}

